<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\api\validate\v1\order;

use think\Validate;

class OrderValidate extends Validate
{
    protected $rule = [
        'address_id' => 'require',
        'cartId' => 'require|array',
        'cart_ids' => 'require|array',
        'order_id' => 'require',
        'fact_price' => 'require',
    ];

    protected $message = [
        'address_id.require' => '缺失地址信息',
        'cartId.require' => '购物商品信息异常',
        'cartId.array' => '购物商品信息异常',
        'cart_ids.require' => '购物商品信息异常',
        'cart_ids.array' => '购物商品信息异常',
        'order_id.require' => '订单ID必传',
        'fact_price.require' => '订单实际支付金额必填',
    ];

    protected $scene = [
        'info' => ['cartId'],
        'create' => ['address_id', 'cart_ids', 'face_price'],
        'again' => ['order_id'],
        'pay' => ['order_id'],
        'detail' => ['order_id'],
        'viewLogistics' => [''],
        'confirmReceipt' => ['order_id'],
        'delete' => ['order_id'],
        'query' => ['order_id'],
    ];
}

